from flask import Flask,render_template,request
app=Flask(__name__)
#1.显示登录表单
@app.route("/")
def showReq():
    return render_template("req.html")
#2.处理request请求
@app.route("/req",methods=["GET","POST"])
def req():
    if request.method=='GET':
        print("url参数为："+request.url)
        print("path参数为：" + request.path)
        print("args参数传递的name为：" + request.args.get("name"))
        print("args参数传递的password为：" + request.args.get("name"))
    if request.method=='POST':
        print("url参数为："+request.url)
        print("path参数为：" + request.path)
        print("args参数传递的name为：" + request.form.get("name"))
        print("args参数传递的password为：" + request.form.get("name"))
    return request.method

if __name__ == '__main__':
    app.run()

